﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using PessModel;
namespace PessMvc.Models
{
    public class ArchivesModel
    {
        public List<Archive> All { get; set; }
        public ArchivesModel(List<Archive> archives)
        {
            this.All = archives;
        }

        public PageInfo PageInfo { get; set; }

        public int ActivityID { get; set; }
        public int SubjectID { get; set; }
        public string Keyword { get; set; }
        public string ArchiveProjectTitleDisplayName { get; set; }
        public string ArchiveSerialNumberDisplayName { get; set; }
        public string ArchiveSubjectNameDisplayName { get; set; }
        public string ArchiveCountyNameDisplayName { get; set; }
        public string ArchiveTeacherNameDisplayName { get; set; }
        public string ArchiveGradeLevelDisplayName { get; set; }
        public string ArchiveSchoolNameDisplayName { get; set; }

        public List<ReviewRecord> ReviewHistory{get;set;}

        public List<ExpertGroup> ExpertGroups { get; set; }

        public List<ArchiveScore> ArchiveScores { get; set; }
        public List<ArchiveGrade> ArchiveGrades { get; set; }
        public List<SubjectGrade> GradeHistory { get; set; }
        /// <summary>
        /// Expert has to assign a grade to each archive.
        /// </summary>
        public bool IsGradeRulesEnabled { get; set; }
        /// <summary>
        /// When IsGradeRulesEnabled is true, an expert has either verified all his grades and completed scoring or not.
        /// </summary>
        public bool IsVerificationCompleted { get; set; }
    }
    public class ArchiveScore
    {
        public int ArchiveID { get; set; }
        public decimal Score { get; set; }
    }
    /// <summary>
    /// Display Grade foreach Archive on Index page.
    /// </summary>
    public class ArchiveGrade
    {
        public int ArchiveID { get; set; }
        public int GradeRuleID { get; set; }
        public string GradeRuleName { get; set;}
    }
    public class GradeRecord
    {
        public int GradeRuleID { get; set; }
        public string GradeRuleName { get; set; }
        /// <summary>
        /// Number of the grade.
        /// </summary>
        public int Count { get; set; }
        public decimal CurrentPercent { get; set; }
        /// <summary>
        /// Percent ceiling
        /// </summary>
        public int? Percent { get; set; }
        public bool? IsValidationRequired { get; set; }
        public int AllowedMaximum { get; set; }
    }
    /// <summary>
    /// For a certain subject, count the number of grades that have assigned.
    /// </summary>
    public class SubjectGrade
    {
        public string SubjectName { get; set; }
        //public int AssignedGradesTotal { get; set; }
        public IEnumerable<GradeRecord> GradeRecords { get; set; }
    }
}